<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改权限|<{$configcache['Title']}></title>
<link rel="stylesheet" type="text/css" href="__CSS__/content.css"  />
<link rel="stylesheet" type="text/css" href="__CSS__/public.css"  />
<script type="text/javascript" src="__JS__/jquery.js"></script>
<script type="text/javascript" src="__JS__/Public.js"></script>
<script type="text/javascript" src="__JS__/winpop.js"></script>
<script type="text/javascript" src="__JS__/check.js"></script>
<script>
$(document).ready(function() {
	$('.button').click(function() {
		var sid=$('#dl dd .select').val();
		var cname=$('#dl dd .qtext').val();
		var description=$('#dl dd .textarea').val();
		var status=$('#dl dd input:checked').val();
		var id=$('#dl input:hidden').val();
		
		if (!tcheck(id,'','ID获取失败')) { return false; }
		if (!tcheck(id,'number','ID获取失败')) { return false; }
		if (!tcheck(sid,'','目录ID获取失败')) { return false; }
		if (!tcheck(sid,'number','目录ID获取失败')) { return false; }
		if (!tcheck(cname,'','请填写权限名称')) { return false; }
		if (!tcheck(cname,'2,20','权限名称请在20个字符以内','length')) { return false; }
		if (!tcheck(description,'0,30','描述请在30个字符以内','length')) { return false; }
		
		wintq('正在修改，请稍后...',4,20000,0,'');
		$.ajax({
			url:'__APP__/Competence/cedit_do/',
			dataType:'json',
			type:'POST',
			data:'id='+id+'&sid='+sid+'&cname='+cname+'&description='+description+'&status='+status,
			success: function(data) {
				if (data.s=='ok') {
					wintq('修改成功',1,1500,0,'__APP__/Competence/cedit/id/'+id);
				}else {
					wintq(data.s,3,1500,1,'');
				}
			}
		});
	});
});
</script>
</head>
<body>
<div id="content">
	<dl id="dl">
    	<dt>修改权限信息</dt>
        <dd>
        	<span class="dd_left">权限分类：</span>
            <span class="dd_right">
            	<select name="sid" class="select">
                	<option value="0">顶级目录</option>
                    <foreach name='volist' item='vo'>
                    <if condition="$vo.ID eq $result['Sid']">
                    <option selected value="<{$vo.ID}>"><{$vo.Cname}></option>
                    <else />
                    <option value="<{$vo.ID}>"><{$vo.Cname}></option>
                    </if>
                    </foreach>
                </select><font>* 选择所属目录</font>
            </span>
        </dd>
        <dd>
        	<span class="dd_left">权限名称：</span>
        	<span class="dd_right"><input type="text" name="cname" class="qtext" value="<{$result['Cname']}>" /><font>* 输入如：用户管理</font></span>
        </dd>
        <dd>
        	<span class="dd_left">权限说明：</span>
            <span class="dd_right"><textarea name="description" class="textarea"><{$result['Description']}></textarea></span>
        </dd>
        <dd>
        	<span class="dd_left">状态：</span>
            <span class="dd_right"><label><input type="radio" name="status" value="0" <if condition="$result['Status'] eq 0">checked</if> /> 正常</label><label><input type="radio" name="status" value="1" <if condition="$result['Status'] eq 1">checked</if> /> 锁定</label><font>* 提示：如果没有修改任何信息，则会提示“数据修改失败”</font></span>
        </dd><input type="hidden" value="<{$result['ID']}>" />
        <dd><input type="button" class="button" value="提 交" /></dd>
    </dl>
</div>
</body>
</html>
